#include <iostream>

using namespace std;

class Single {
public:
	static Single& getInstance() {
		static Single s;
		return s;
	}
	int a;
	void set(int a) {
		this->a = a;
	}
	int get() {
		return a;
	}
private:
	Single() = default;
	~Single() = default;
	
	Single(const Single&) = delete;
	Single(Single&&) = delete;
	Single& operator=(const Single&) = delete;
	Single&& operator=(Single&&) = delete;
};

int main() {
	Single& s1 = Single::getInstance();
	s1.set(10);
	cout << s1.get() << endl;
	Single& s2 = Single::getInstance();
	s2.set(20);
	cout << s1.get() << endl;
	return 0;
}

